package temp

import (
	"background/model/back/entity"
	"gorm.io/gorm"
	"time"
)

type Order struct {
	gorm.Model
	UserId    int       `gorm:"column:user_id;comment:'用户ID';type:bigint;"            json:"user_id"`
	Number    string    `gorm:"column:number;comment:'订单号';type:varchar(255);"   json:"number"`
	State     int       `gorm:"column:state;comment:'订单状态/1完成/0等待，取消';type:smallint"            json:"state"`
	Price     int       `gorm:"column:price;comment:'价格';type:integer;"            json:"price"`
	Pay       int       `gorm:"column:pay;comment:'付款';type:int;"            json:"pay"`
	PayAt     time.Time `gorm:"column:pay_at;comment:'付款时间';"            json:"pay_at"`
	Note      int       `gorm:"column:note;comment:'备注';type:varchar(255);"            json:"note"`
	PlanID    int       `gorm:"column:plan_id;comment:'套餐id';type:bigint" json:"plan_id"`
	PaymentID int       `gorm:"column:payment_id;comment:'支付方式';type:bigint" json:"payment_id"`
	Period    int       `gorm:"column:period;comment:'周期';type:smallint" json:"period"`
}

func (c Order) TableName() string {
	return entity.ProjectPre + "order"
}
